using System;
using System.Collections.Generic;
using System.Text;
using Bots;
using Bots.Search;
using Lucene.Net.Search;
using Lucene.Net.Documents;
using Lucene.Net.Analysis.Standard;

namespace Sample
{
    public class LinkSearcher : SearcherWrapper
    {
        protected override string[] QueryFields
        {
            get { return new string[] {"Title", "Url", "Description" }; }
        }

        public LinkSearcher() { }

        protected override DomainObject ToDomainObject(Document doc)
        {
            Link link = new Link(Convert.ToInt64(doc.Get("ID")));
            link.Title = doc.Get("Title");
            link.Url = doc.Get("Url");
            link.Description = doc.Get("Description");
            link.CreateDateTime = Convert.ToDateTime(doc.Get("CreateDate"));
            return link;
        }
    }
}
